#include "StdAfx.h"
#include "rtp_data_mgr.h"
#include "video_mgr.h"
#include "audio_mgr.h"
rtp_data_mgr::rtp_data_mgr(void)
{
	m_lpv = NULL;
	m_lpa = NULL;
	m_prtp_mgr = NULL;
	m_pvideo_recv_cache = NULL;
	m_paudio_recv_cache = NULL;
}

rtp_data_mgr::~rtp_data_mgr(void)
{
}
bool rtp_data_mgr::init_rtp_data_mgr(void *lpv,void *lpa,void *lpr)
{
	m_lpv = lpv;
	m_lpa = lpa;
	m_prtp_mgr = lpr;
	m_pvideo_recv_cache = (unsigned char *)malloc(200*1024);
	m_paudio_recv_cache = (unsigned char *)malloc(1024);
	return true;
}
bool rtp_data_mgr::process_audio_data(unsigned char *pdata,unsigned int len)
{
	return ((play_audio_mgr *)m_lpa)->play_audio_data(pdata,len);
}
bool rtp_data_mgr::process_video_data(unsigned char *pdata,unsigned int len)
{
	return ((play_video_mgr *)m_lpv)->play_video_data(pdata,len);
}
bool rtp_data_mgr::close_rtp_data_mgr()
{
	free(m_paudio_recv_cache);
	m_paudio_recv_cache = NULL;
	free(m_pvideo_recv_cache);
	m_pvideo_recv_cache = NULL;
	return true;
}